/**  
* @Title: BannerController.java
* @Package com.lemon.controller.crwx
* @Description: (一句话阐述):
* @author Ran_cc
* @date 2018年11月30日
* @version V1.0  
*/
package com.lemon.controller.crwx;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.lemon.conf.MyException;
import com.lemon.model.cityRun.CrAdBanner;
import com.lemon.service.cityRun.CrAdBannerService;
import com.lemon.utils.ReqResult;

/**
 * <p>Title: BannerController</p>
 * <p>Description: 
 * </p>
 * <p>Company: </p>
 * @author Ran_cc
 * @date 2018年11月30日
 * @版本 V 1.0 
 */
@RestController
@RequestMapping("/xad")
public class WxBannerController {
	@Resource
	private CrAdBannerService adService;

	//获取全部用户信息
	@RequestMapping("/getBannerList")
	public ReqResult getShopsList(@ModelAttribute CrAdBanner ad , HttpServletRequest request ,
			HttpServletResponse response) {
		ReqResult reqResult = new ReqResult();

		try {
			ad.setWhere(" and  status = 1 ");
			ad.setOrderBy(" order By sort asc ");
			List<CrAdBanner> selectListBySelective = adService.selectListBySelective(ad);
			reqResult.setReturnResult(selectListBySelective);
		} catch (Exception e) {
			reqResult.setReturnResult("" , ReqResult.code_error);
			MyException.writeErr(e , "查询客户或管理员列表失败");
		}
		return reqResult;
	}
}
